package com.wlyuan.open.scanner.utils.enums.named;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import com.wlyuan.core.named.TransportMode;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum TransportModeEnum implements NamedValue<Integer> {

    LESS(1, TransportMode.DIVIDE.getValue(), "零担"),
    FULL(2, TransportMode.WHOLE.getValue(), "整车");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, TransportModeEnum> MAP = new NamedValueMap<>(TransportModeEnum.class);

    public static TransportModeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
